
def b_search(arr,target):
    low=0
    high=len(arr)-1
    while low<=high:
        mid=(low+high)//2
        if target<arr[mid]:
            high=mid-1
        elif target>arr[mid]:
            low=mid+1
        else:
            return mid
    return -1


if __name__ == '__main__':
    arr=[13, 20, 30, 31, 32, 53, 55, 85, 86, 89]
    print(b_search(arr,31))